package cn.itsource.org.domain;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.itsource.common.domain.BaseDomain;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class Department extends BaseDomain {
    //部门编号
    @Excel(name = "部门编号",orderNum = "1",width = 30)
    private String sn;
    //部门名
    @ApiModelProperty("部门名")
    @Excel(name = "部门名",orderNum = "2",width = 30)
    private String name;
    //部门路径(表示部门的层级关系)
    @ApiModelProperty("部门路径(表示部门的层级关系")
    @Excel(name = "部门路径",orderNum = "3",width = 30)
    private String dirPath;
    //部门状态 1:正常 0:禁用
    @Excel(name = "部门状态",replace = { "启用_1", "禁用_0" },orderNum = "4",width = 30)
    private Integer state = 1;
    //部门经理id
    private Long manager_id;
    //部门经理
//    @Excel(name = "部门经理",orderNum = "5",width = 30)
    private Employee manager;
    //上级部门id
    private Long parent_id;
    //上级部门
    private Department parent;

    //创建一个字段，专门封装子部门的
    @JsonInclude(JsonInclude.Include.NON_EMPTY) // 如果是一个空集合，我json输出的时候，就不返回
    private List<Department> children = new ArrayList<Department>();


}
